/* 主体样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* 暗黑模式 */
body.dark-mode {
    background-color: #0f172a;
    color: #e2e8f0;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 标题 */
h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
    text-align: center;
}

body.dark-mode h1 {
    color: #ecf0f1;
}

/* 查询容器 */
.query-container {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.query-container:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

body.dark-mode .query-container {
    background: #2c2c2c;
}

/* 输入组 */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* 输入框 */
.query-input {
    flex: 1;
    padding: 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    font-size: 1.125rem;
    outline: none;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.query-input:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    background-color: white;
}

body.dark-mode .query-input {
    background: #3c3c3c;
    border-color: #555;
    color: #e0e0e0;
}

/* 按钮 */
.btn {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    letter-spacing: -0.01em;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 16px -4px rgba(79, 70, 229, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

body.dark-mode .btn {
    background: linear-gradient(135deg, #2980b9 0%, #1c5a8a 100%);
}

/* 结果容器 */
.result-container {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.result-container:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body.dark-mode .result-container {
    background: #2c2c2c;
}

/* 知识图谱容器 */
.graph-container {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    height: 500px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

body.dark-mode .graph-container {
    background: #2c2c2c;
}

/* 节点样式 */
.node {
    stroke: #fff;
    stroke-width: 1.5px;
}

body.dark-mode .node {
    stroke: #555;
}

/* 链接样式 */
.link {
    stroke: #999;
    stroke-opacity: 0.6;
}

body.dark-mode .link {
    stroke: #777;
}

/* 搜索结果 */
.search-results {
    max-height: 400px;
    overflow-y: auto;
}

/* 历史记录 */
.history-list {
    max-height: 300px;
    overflow-y: auto;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 5px solid rgba(79, 70, 229, 0.2);
    border-top: 5px solid #4F46E5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transition: all 0.3s ease;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 折叠面板样式 */
.collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background-color: #f1f5f9;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.collapse-header:hover {
    background-color: #e2e8f0;
}

.collapse-icon {
    transition: transform 0.3s ease;
    font-size: 1.25rem;
    color: #64748b;
}

.collapse-content {
    padding: 1.25rem;
    background-color: #f8fafc;
    border-radius: 0.75rem;
    border-left: 4px solid #4F46E5;
    transition: all 0.3s ease;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar.dark-mode {
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    color: #64748b;
    font-size: 0.875rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer.dark-mode {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .query-container, .result-container, .graph-container {
        padding: 1.75rem;
        border-radius: 1.25rem;
    }
    
    .query-input {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .btn {
        padding: 1rem 1.75rem;
        font-size: 1rem;
    }
    
    .graph-container {
        height: 300px;
    }
    
    .collapse-header, .collapse-content {
        padding: 1rem;
    }
}